//
//                  Simu5G
//
// Authors: Giovanni Nardini, Giovanni Stea, Antonio Virdis (University of Pisa)
//
// This file is part of a software released under the license included in file
// "license.pdf". Please read LICENSE and README files before using it. 
// The above files and the present reference are part of the software itself,
// and cannot be removed from it.
//

package simu5g.apps.cbr;

import inet.applications.contract.IApp;


simple CbrSender like IApp
{
    parameters:
        int localPort = default(-1);
        int destPort = default(3000);
        string destAddress;
        int PacketSize = default(40);
        double sampling_time @unit("s") = default(0.02s);
        double startTime @unit("s") = default(0s);
        double finishTime @unit("s") = default(0s);
        int tos = default(-1); // if not -1, set the Type Of Service (IPv4) / Traffic Class (IPv6) field of sent packets to this value
        
        @signal[cbrGeneratedThroughtputSignal];
        @statistic[cbrGeneratedThroughtput](title="Throughput generated by the application"; unit="Bps"; source="cbrGeneratedThroughtputSignal"; record=timeavg,mean,vector,"last(sumPerDuration)",sum);

        @signal[cbrGeneratedBytesSignal];
        @statistic[cbrGeneratedBytes](title="Bytes generated by the application"; unit="Bps"; source="cbrGeneratedBytesSignal"; record=timeavg,mean,"last(sumPerDuration)",sum);

        @signal[cbrSentPktSignal];
        @statistic[cbrSentPkt](title="Sent packet ID"; unit=""; source="cbrSentPktSignal"; record=vector);
        
        @display("i=block/source");
    gates:
        output socketOut;
        input socketIn;
}
